<?php
	global $_W,$_GPC;
	if($_W['role']){
		$page = $_GPC['page'];
		$pindex = max(1, intval($page));	
		$psize = 10;
		$sql = "SELECT o.oid,o.orderid,o.book_id,o.is_pay,o.is_ok,o.pay_money,o.tmoney,o.goods_money,o.details,o.addtime,o.order_type,g.titlepic  FROM".tablename('mii_ang_order')." o LEFT JOIN ".tablename('mii_ang_goods')." g ON o.goods_id = g.id  WHERE o.uniacid=:uniacid  ORDER BY o.oid DESC LIMIT ".($pindex-1)*$psize.','.$psize;
		$order = pdo_fetchall($sql,array(':uniacid'=>$_W['uniacid']));
		$countSql = "SELECT COUNT(*)FROM " . tablename('mii_ang_order')." WHERE uniacid ={$_W['uniacid']}";
		$total = pdo_fetchcolumn($countSql);
		$pager = pagination($total, $pindex, $psize,$url='',$context = array('before' =>1, 'after' => 1, 'ajaxcallback' => '', 'callbackfuncname' => ''));	
		include $this->template('web/order/orderlist');
	}else{
		message('没有操作的权限');
	}

	function dejson($options,$key){
		$data = json_decode($options,true);
		return $data[$key];
	}

?>